package com.yaoyou.dao;

import com.yaoyou.model.dataObject.IdRatePair;
import com.yaoyou.model.dataObject.ShopInfo;
import com.yaoyou.model.dataObject.ShopInfoExample;
import java.util.List;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.DeleteProvider;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.InsertProvider;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Result;
import org.apache.ibatis.annotations.Results;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.SelectProvider;
import org.apache.ibatis.annotations.Update;
import org.apache.ibatis.annotations.UpdateProvider;
import org.apache.ibatis.type.JdbcType;

public interface ShopInfoMapper {
    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table SHOP_INFO
     *
     * @mbggenerated Wed Jul 27 23:09:00 CST 2016
     */
    @SelectProvider(type=ShopInfoSqlProvider.class, method="countByExample")
    int countByExample(ShopInfoExample example);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table SHOP_INFO
     *
     * @mbggenerated Wed Jul 27 23:09:00 CST 2016
     */
    @DeleteProvider(type=ShopInfoSqlProvider.class, method="deleteByExample")
    int deleteByExample(ShopInfoExample example);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table SHOP_INFO
     *
     * @mbggenerated Wed Jul 27 23:09:00 CST 2016
     */
    @Delete({
        "delete from SHOP_INFO",
        "where SHOP_INFO_ID = #{shopInfoId,jdbcType=VARCHAR}"
    })
    int deleteByPrimaryKey(String shopInfoId);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table SHOP_INFO
     *
     * @mbggenerated Wed Jul 27 23:09:00 CST 2016
     */
    @Insert({
        "insert into SHOP_INFO (SHOP_INFO_ID, SHOP_NAME, ",
        "SEQ, SHOP_ADDRESS, ",
        "SHOP_TEL, IS_SEND, ",
        "IMG_URL, GPS_X, GPS_Y, ",
        "STATE, CREATE_USER_NAME, ",
        "CREATE_TIME, CREATE_USER_ID, ",
        "AVG_RATE)",
        "values (#{shopInfoId,jdbcType=VARCHAR}, #{shopName,jdbcType=VARCHAR}, ",
        "#{seq,jdbcType=INTEGER}, #{shopAddress,jdbcType=VARCHAR}, ",
        "#{shopTel,jdbcType=VARCHAR}, #{isSend,jdbcType=VARCHAR}, ",
        "#{imgUrl,jdbcType=VARCHAR}, #{gpsX,jdbcType=DECIMAL}, #{gpsY,jdbcType=DECIMAL}, ",
        "#{state,jdbcType=VARCHAR}, #{createUserName,jdbcType=VARCHAR}, ",
        "#{createTime,jdbcType=TIMESTAMP}, #{createUserId,jdbcType=VARCHAR}, ",
        "#{avgRate,jdbcType=DECIMAL})"
    })
    int insert(ShopInfo record);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table SHOP_INFO
     *
     * @mbggenerated Wed Jul 27 23:09:00 CST 2016
     */
    @InsertProvider(type=ShopInfoSqlProvider.class, method="insertSelective")
    int insertSelective(ShopInfo record);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table SHOP_INFO
     *
     * @mbggenerated Wed Jul 27 23:09:00 CST 2016
     */
    @SelectProvider(type=ShopInfoSqlProvider.class, method="selectByExample")
    @Results({
        @Result(column="SHOP_INFO_ID", property="shopInfoId", jdbcType=JdbcType.VARCHAR, id=true),
        @Result(column="SHOP_NAME", property="shopName", jdbcType=JdbcType.VARCHAR),
        @Result(column="SEQ", property="seq", jdbcType=JdbcType.INTEGER),
        @Result(column="SHOP_ADDRESS", property="shopAddress", jdbcType=JdbcType.VARCHAR),
        @Result(column="SHOP_TEL", property="shopTel", jdbcType=JdbcType.VARCHAR),
        @Result(column="IS_SEND", property="isSend", jdbcType=JdbcType.VARCHAR),
        @Result(column="IMG_URL", property="imgUrl", jdbcType=JdbcType.VARCHAR),
        @Result(column="GPS_X", property="gpsX", jdbcType=JdbcType.DECIMAL),
        @Result(column="GPS_Y", property="gpsY", jdbcType=JdbcType.DECIMAL),
        @Result(column="STATE", property="state", jdbcType=JdbcType.VARCHAR),
        @Result(column="CREATE_USER_NAME", property="createUserName", jdbcType=JdbcType.VARCHAR),
        @Result(column="CREATE_TIME", property="createTime", jdbcType=JdbcType.TIMESTAMP),
        @Result(column="CREATE_USER_ID", property="createUserId", jdbcType=JdbcType.VARCHAR),
        @Result(column="AVG_RATE", property="avgRate", jdbcType=JdbcType.DECIMAL)
    })
    List<ShopInfo> selectByExample(ShopInfoExample example);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table SHOP_INFO
     *
     * @mbggenerated Wed Jul 27 23:09:00 CST 2016
     */
    @Select({
        "select",
        "SHOP_INFO_ID, SHOP_NAME, SEQ, SHOP_ADDRESS, SHOP_TEL, IS_SEND, IMG_URL, ",
        "GPS_X, GPS_Y, STATE, CREATE_USER_NAME, CREATE_TIME, CREATE_USER_ID, AVG_RATE",
        "from SHOP_INFO",
        "where SHOP_INFO_ID = #{shopInfoId,jdbcType=VARCHAR}"
    })
    @Results({
        @Result(column="SHOP_INFO_ID", property="shopInfoId", jdbcType=JdbcType.VARCHAR, id=true),
        @Result(column="SHOP_NAME", property="shopName", jdbcType=JdbcType.VARCHAR),
        @Result(column="SEQ", property="seq", jdbcType=JdbcType.INTEGER),
        @Result(column="SHOP_ADDRESS", property="shopAddress", jdbcType=JdbcType.VARCHAR),
        @Result(column="SHOP_TEL", property="shopTel", jdbcType=JdbcType.VARCHAR),
        @Result(column="IS_SEND", property="isSend", jdbcType=JdbcType.VARCHAR),
        @Result(column="IMG_URL", property="imgUrl", jdbcType=JdbcType.VARCHAR),
        @Result(column="GPS_X", property="gpsX", jdbcType=JdbcType.DECIMAL),
        @Result(column="GPS_Y", property="gpsY", jdbcType=JdbcType.DECIMAL),
        @Result(column="STATE", property="state", jdbcType=JdbcType.VARCHAR),
        @Result(column="CREATE_USER_NAME", property="createUserName", jdbcType=JdbcType.VARCHAR),
        @Result(column="CREATE_TIME", property="createTime", jdbcType=JdbcType.TIMESTAMP),
        @Result(column="CREATE_USER_ID", property="createUserId", jdbcType=JdbcType.VARCHAR),
        @Result(column="AVG_RATE", property="avgRate", jdbcType=JdbcType.DECIMAL)
    })
    ShopInfo selectByPrimaryKey(String shopInfoId);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table SHOP_INFO
     *
     * @mbggenerated Wed Jul 27 23:09:00 CST 2016
     */
    @UpdateProvider(type=ShopInfoSqlProvider.class, method="updateByExampleSelective")
    int updateByExampleSelective(@Param("record") ShopInfo record, @Param("example") ShopInfoExample example);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table SHOP_INFO
     *
     * @mbggenerated Wed Jul 27 23:09:00 CST 2016
     */
    @UpdateProvider(type=ShopInfoSqlProvider.class, method="updateByExample")
    int updateByExample(@Param("record") ShopInfo record, @Param("example") ShopInfoExample example);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table SHOP_INFO
     *
     * @mbggenerated Wed Jul 27 23:09:00 CST 2016
     */
    @UpdateProvider(type=ShopInfoSqlProvider.class, method="updateByPrimaryKeySelective")
    int updateByPrimaryKeySelective(ShopInfo record);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table SHOP_INFO
     *
     * @mbggenerated Wed Jul 27 23:09:00 CST 2016
     */
    @Update({
        "update SHOP_INFO",
        "set SHOP_NAME = #{shopName,jdbcType=VARCHAR},",
          "SEQ = #{seq,jdbcType=INTEGER},",
          "SHOP_ADDRESS = #{shopAddress,jdbcType=VARCHAR},",
          "SHOP_TEL = #{shopTel,jdbcType=VARCHAR},",
          "IS_SEND = #{isSend,jdbcType=VARCHAR},",
          "IMG_URL = #{imgUrl,jdbcType=VARCHAR},",
          "GPS_X = #{gpsX,jdbcType=DECIMAL},",
          "GPS_Y = #{gpsY,jdbcType=DECIMAL},",
          "STATE = #{state,jdbcType=VARCHAR},",
          "CREATE_USER_NAME = #{createUserName,jdbcType=VARCHAR},",
          "CREATE_TIME = #{createTime,jdbcType=TIMESTAMP},",
          "CREATE_USER_ID = #{createUserId,jdbcType=VARCHAR},",
          "AVG_RATE = #{avgRate,jdbcType=DECIMAL}",
        "where SHOP_INFO_ID = #{shopInfoId,jdbcType=VARCHAR}"
    })
    int updateByPrimaryKey(ShopInfo record);
}